import request from '@/utils/request'

// 工时列表分页
export function getWorkingPage(data) {
    return request({
        url: 'working/getWorkingPage',
        method: 'post',
        data
    })
}


// 新增工时
export function createdWorking(data) {
    return request({
        url: 'working/createdWorking',
        method: 'post',
        data
    })
}

// 修改工时
export function updateWorking(data) {
    return request({
        url: 'working/updateWorking',
        method: 'post',
        data
    })
}


//   删除工时
export function delWorking(id) {
    return request({
        url: `working/delWorking?id=${id}`,
        method: 'get'
    })
}



// 工时汇总
export function getWorkingPageAdmin(data) {
    return request({
        url: 'admin/working/getWorkingPage',
        method: 'post',
        data
    })
}


// 导出工时
export function downloadAdminWorkingFile() {
    return request({
        url: 'admin/working/downloadAdminWorkingFile',
        method: 'post',
        responseType: 'blob'
    })
}

// 部门工时筛选
export function getAllWorkingPageByDeptId(data) {
    return request({
        url: 'admin/working/getAllWorkingPageByDeptId',
        method: 'post',
        data
    })
}

// 部门工时-获取指定用户工时数据
export function getWorkingDataByUserId(data) {
    return request({
        url: 'admin/working/getWorkingDataByUserId',
        method: 'post',
        data
    })
}

//  更新工时金额
export function setWorkAmount(data){
    return request({
        url: 'working/setWorkAmount',
        method: 'post',
        data
    })
}

// 获取用户部门图表信息
export function getChartsData(data){
    return request({
        url: 'admin/working/getChartsData',
        method: 'post',
        data
    })
}